<template>
  <div class="see-template" id="article-content">
    <div class="template">
      <div class="header">
        <span class="title">{{ add == 1 ? "新增渠道" : "订单详情" }}</span>
        <i
          @click="closeAddTemplate"
          class="icon iconfont iconguanbi cl-iconfont is-circle"
        ></i>
      </div>
      <el-form
        class="base-ariticle"
        @submit.native.prevent
        :model="productDetail"
        ref="contentForm"
      >
        <el-form-item label="订单编号" prop="id">
          <span>：{{ productDetail.id }}</span>
        </el-form-item>
        <el-form-item label="产品名称" prop="productCode">
          <span>：{{ productDetail.productCode }}</span>
        </el-form-item>
        <el-form-item label="订单类型" prop="tradeType">
          <span>：{{ productDetail.tradeType | TradeType }}</span>
        </el-form-item>
        <el-form-item label="订单渠道" prop="channelName">
          <span>：{{ productDetail.channelName }}</span>
        </el-form-item>
        <el-form-item label="订单来源" prop="orderSource">
          <span>：{{ productDetail.orderSource | Source }}</span>
        </el-form-item>
        <el-form-item label="交易时间" prop="paymentTime">
          <span>：{{ productDetail.paymentTime }}</span>
        </el-form-item>
        <el-form-item label="订单状态" prop="status">
          <span>：{{ productDetail.status | Orders }}</span>
        </el-form-item>
        <el-form-item label="订单金额" prop="actualPrice">
          <span>：{{ productDetail.actualPrice }}</span>
        </el-form-item>
      </el-form>

      <div class="footer">
        <Debounce :time="1000">
          <button
            class="cl-button cl-button--primary_notbg"
            @click="closeAddTemplate"
          >
            取消
          </button>
        </Debounce>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ["productDetail", "add"],
  data() {
    return {
      siteId: this.$store.state.dashboard.siteId,
      options: [
        {
          value: 1,
          label: "上架",
        },
        {
          value: 0,
          label: "下架",
        },
      ],
    };
  },
  filters: {
    Source: function (row) {
      switch (row) {
        case 1:
          return "阿里";
        case 2:
          return "百度";
        case 3:
          return "腾讯";
        case 4:
          return "京东";
        case 5:
          return "金山";
        case 6:
          return "华为";
        case 7:
          return "生产平台";
      }
    },

    TradeType: function (row) {
      switch (row) {
        case 1:
          return "新购";
        case 2:
          return "续费";
        case 3:
          return "退款";
        case 4:
          return "过期";
        case 5:
          return "升级";
      }
    },
    Orders: function (row) {
      switch (row) {
        case 1:
          return "未支付";
        case 2:
          return "已支付";
        case 3:
          return "已退款";
        case 4:
          return "已取消";
        default:
          return "不知道";
      }
    },
  },
  created() {},
  mounted() {},

  methods: {
    preservation() {
      this.$emit("closeAddTemplate");
    },
    closeAddTemplate() {
      this.$emit("closeAddTemplate");
    },
  },
};
</script>

<style lang="scss" scoped>
form {
  padding: 0 25px;
}
.cl-button--primary_notbg {
  margin-left: 24px;
}
.el-progress-bar__innerText {
  color: red !important;
}
.divProgressa {
  width: 80%;
}
.forProgress {
  margin-bottom: 10px;
}
.seeInformation {
  color: #999999;
  font-size: 14px;
  display: flex;
  justify-content: center;
  align-items: center;
}
.progressTitle {
  display: flex;
}
.divProgress {
  display: flex;
}
.forContent {
  margin-bottom: 40px;
  padding: 0 20px;
}
.progerss {
  margin-top: 10px;
  margin-bottom: 10px;
}
.progressTitles {
  color: #666666;
  font-size: 14px;
}
.progerssTxt {
  font-weight: bold;
  color: #000;
  font-size: 14px;
  margin-top: 8px;
  margin-bottom: 24px;
}
.divInput {
  color: rgba(102, 102, 102, 1);
  margin-bottom: 8px;
  font-size: 14px;
}
.see-template {
  position: fixed;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  box-sizing: border-box;
  background: rgba(38, 38, 38, 0.8);
  z-index: 2000;
  .template {
    position: relative;
    margin: 0 0 0 auto;
    height: 100%;
    min-height: 600px;
    width: 400px;
    // padding: 10px 24px 16px;
    box-sizing: border-box;
    background: #ffffff;
    .header {
      display: flex;
      justify-content: space-between;
      border-bottom: $--border-base;
      margin-bottom: 20px;
      span {
        font-size: $--font-size-base;
        color: $--color-text-primary;
        line-height: 44px;
        margin-left: 20px;
      }
      i {
        line-height: 14px;
        padding: 14px;
        height: 14px;
        width: 14px;
      }
    }
    .content {
      .input {
        // display: flex;
        // justify-content: space-between;
        margin-top: 24px;
        // text-align: right;

        span {
          width: 130px;
          line-height: 32px;
          margin-right: 10px;
          .ak-titleIcon {
            color: $--color-danger;
            font-size: 16px;
            vertical-align: middle;
            margin-right: 8px;
          }
        }
      }
      a {
        cursor: pointer;
        display: inline-block;
        margin: 12px 0 0 105px;
        color: $--color-primary;
        font-size: $--font-size-small;
      }
    }
    .save {
      padding-top: 24px;
      div {
        font-size: $--font-size-small;
        color: $--color-text-primary;
        line-height: 18px;
        margin-bottom: 16px;
        span {
          float: left;
          width: 80px;
          text-align: right;
        }
        p {
          margin-left: 80px;
          line-height: 18px;
        }
      }
    }
    .footer {
      position: absolute;
      left: 0;
      bottom: 0;
      height: 64px;
      padding: 16px 0;
      border-top: $--border-base;
      box-sizing: border-box;
      width: 100%;
      background-color: #ffffff;
    }
  }
}
</style>